package com.example.auth.dto;

import lombok.Data;
import java.time.LocalDateTime;

/**
 * Student Project Progress DTO
 * Used for supervisor console to display student project progress information
 */
@Data
public class StudentProjectProgressDTO {
    // Student information
    private Long studentId;
    private String studentName;
    private String studentNumber; // Student number

    // Project information
    private Long projectId;
    private String projectTitle;
    private String projectStatus;

    // Progress information
    private Integer totalTasks;     // Total number of tasks
    private Integer completedTasks; // Number of completed tasks
    private Double progressPercentage; // Progress percentage

    // Recent activity
    private LocalDateTime lastActivity;
    private String lastActivityDescription;

    // Status information
    private String status; // Active, Inactive

    // Deadline information
    private LocalDateTime deadline;
    private Boolean isOverdue;

    // Calculate remaining tasks
    public Integer getRemainingTasks() {
        return totalTasks - completedTasks;
    }

    // Calculate if nearing the deadline (within 7 days)
    public Boolean isNearDeadline() {
        if (deadline == null) {
            return false;
        }
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime weekLater = now.plusDays(7);
        return deadline.isBefore(weekLater) && deadline.isAfter(now);
    }
}